<?php

namespace App\Http\Middleware;

use Closure;
use View;
use App\Services\IWeixinService;
use App\Services\ISessionService;

class Project
{

    private $sessionService;
    private $weixinService;

    public function __construct(ISessionService $sessionService, IWeixinService $weixinService)
    {
        $this->sessionService = $sessionService;
        $this->weixinService = $weixinService;
    }

    /**
     * Handle an incoming request.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \Closure  $next
     * @return mixed
     */
    public function handle($request, Closure $next)
    {
        View::share('signPackage',$this->weixinService->GetSignPackage());
        return $next($request);
    }
}
